package cc.geguol.iodemo.stream2char;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.OutputStreamWriter;

/**
 * 作者：13687
 * 日期：2017/6/17
 * 项目：IODemo
 * 描述：从键盘输入字节
 * 转换成字符输出
 */
public class streamReaderDemo {
	public static void main(String[] args) throws IOException {
		InputStream inputStream = System.in;

		InputStreamReader inputStreamReader = new InputStreamReader(inputStream);

		BufferedReader bufferedReader = new BufferedReader(inputStreamReader);

//		将字符流转成字节流
		OutputStreamWriter outputStreamWriter = new OutputStreamWriter(System.out);
		String str = null;
		while ((str=bufferedReader.readLine())!=null){
//			System.out.println(str.toUpperCase());
			outputStreamWriter.write(str.toUpperCase());
			outputStreamWriter.flush();//如果不加这句 会有缓冲区
		}

	}
}
